<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字幕资源管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }

        function preview(sourceType, sourceId) {
            top.$.jBox.open("iframe:${ctx}/templet/eleTemplet/preview?sourceType="+sourceType+"&sourceId=" + sourceId, "<spring:message code='preview'/>", 500, 420, {showScrolling: false});
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/">
            <spring:message code="subtitle.list"/>
        </a></li>
		<shiro:hasPermission name="source:subtitle:eleSourceSubtitleGroup:edit"><li>
            <a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/form">
                <spring:message code="subtitle.add"/>
            </a></li></shiro:hasPermission>
    </ul>
	<form:form id="searchForm" modelAttribute="eleSourceSubtitleGroup" action="${ctx}/source/subtitle/eleSourceSubtitleGroup/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label> <spring:message code="subtitle.name"/>：</label>
				<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.Query'/>"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed" >
		<thead>
			<tr>
				<th><spring:message code="common.dname"/></th>
				<th><spring:message code='font.color'/></th>
				<th><spring:message code='background.color'/></th>
                <th><spring:message code='font.size'/></th>
				<th><spring:message code='subtitle.picture'/></th>
				<th><spring:message code='subtitle.speed'/></th>
				<th><spring:message code='subtitle.direction'/></th>
				<th><spring:message code='Corresponding.floor'/></th>
				<th><spring:message code='common.update_time'/></th>
				<th><spring:message code='common.creater'/></th>
				<th><spring:message code='audit.state'/></th>

				<th><spring:message code='common.operation'/></th>
				<th><spring:message code='common.remarks'/></th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="eleSourceSubtitleGroup">
			<tr>
				<td><a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/form?id=${eleSourceSubtitleGroup.id}">
						${eleSourceSubtitleGroup.name}
				</a></td>
				<td>
					<span title="${eleSourceSubtitleGroup.fgcolor}"
						  style="display: block;width: 80px;height: 40px;
								  border: 1px solid;
								  background-color: ${fns:getColor(eleSourceSubtitleGroup.fgcolor)};"></span>
				</td>
				<td>
					<span title="${eleSourceSubtitleGroup.bgcolor}"
						  style="display: block;width: 80px;height: 40px;
								  border: 1px solid;
								  background-color: ${fns:getColor(eleSourceSubtitleGroup.bgcolor)};"></span>
				</td>
                <td>
                        ${eleSourceSubtitleGroup.fontsize}
                </td>
				<td style="background-color:#B5B5B5;">
					<img src="${fn:replace(eleSourceSubtitleGroup.bgimage, '|', '')}" style="height: 40px;">
				</td>
				<td>
					${eleSourceSubtitleGroup.speed}
				</td>
				<td>
					${fns:getDictLabel(eleSourceSubtitleGroup.orientation, 'textori', '')}
				</td>
				<td>
					${fns:getDictLabel(eleSourceSubtitleGroup.toFloor, 'truefalse', '')}
				</td>
				
				<td>
					<fmt:formatDate value="${eleSourceSubtitleGroup.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${eleSourceSubtitleGroup.createBy.name}
				</td>
				<td>
					<c:if test="${eleSourceSubtitleGroup.group != null}">
                    <c:if test="${eleSourceSubtitleGroup.group.delFlag == '0'}">
                       <spring:message code="approved"/>
                    </c:if>
                    <c:if test="${eleSourceSubtitleGroup.group.delFlag == '1'}">
                        <spring:message code='common.delete'/>
                    </c:if>
                    <c:if test="${eleSourceSubtitleGroup.group.delFlag == '2'}">
                        <spring:message code='inapproval'/>
                    </c:if>
                    <c:if test="${eleSourceSubtitleGroup.group.delFlag == '3'}">
                        <spring:message code="rejected"/>
                    </c:if>
                    </c:if>
                </td>

				<td>
					<shiro:hasPermission name="source:subtitle:eleSourceSubtitleGroup:edit">
						<a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/form?id=${eleSourceSubtitleGroup.id}"><spring:message
								code="common.modify"/></a>
						<a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/applypublish?id=${eleSourceSubtitleGroup.id}"><spring:message
								code="publish"/></a>

						<a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/delete?id=${eleSourceSubtitleGroup.id}"
						   onclick="return confirmx('<spring:message code='tips.delsubtitle' />', this.href)"><spring:message
								code='common.delete'/></a>

						<shiro:hasPermission name="source:subtitle:eleSourceSubtitleGroup:check">
							<a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/check?id=${eleSourceSubtitleGroup.id}">审核</a>
						</shiro:hasPermission>

					</shiro:hasPermission>
					<a href="javascript:void(0);" onclick="preview('sub','${eleSourceSubtitleGroup.id}')">
						<spring:message code="preview"/>
					</a>
				</td>
				<td>
						${eleSourceSubtitleGroup.remarks}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>